import { defineStore } from 'pinia';
import { ref } from 'vue';
import type { Route } from '@/types/route'; 

export const useRouterStore = defineStore('router', () => {
    const dynamicRoutes = ref<Route[]>([]);
    const hasFetchedRoutes = ref(false);

    const setDynamicRoutes = (routes: Route[]) => {
        dynamicRoutes.value = routes;
        hasFetchedRoutes.value = true;
    };

    return {
        dynamicRoutes,
        hasFetchedRoutes,
        setDynamicRoutes
    };
});